//
//  Tools.m
//  11UITableView3
//
//  Created by lanou on 15/11/24.
//  Copyright (c) 2015年 JasperSong. All rights reserved.
//

#import "Tools.h"

@implementation Tools

+ (CGFloat)heightForString:(NSString *)str
          systemFontOfSize:(CGFloat)size
                     width:(CGFloat)width{
    NSDictionary *fontDic = @{ NSFontAttributeName : [UIFont systemFontOfSize:size]};
    CGRect textRect = [str boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:fontDic context:nil];
    return textRect.size.height;
}
@end
